package com.lwj.liwanjia.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.lwj.liwanjia.R;
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;

import java.util.List;

/**
 * Created by Administrator on 2017/10/9.
 */

public class TkDialogAdapter extends SuperBaseAdapter<String> {

    private int checkPosition;

    public void setCheckPosition(int checkPosition) {
        this.checkPosition = checkPosition;
    }

    public TkDialogAdapter(Context context, List<String> data) {
        super(context, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, String item, int position) {
        holder.setText(R.id.tv_content, item);
        if (checkPosition == position) {
            holder.setImageResource(R.id.iv_select, R.mipmap.tui_kuang_1);
        } else {
            holder.setImageResource(R.id.iv_select, R.mipmap.tui_kuang_2);

        }
    }

    @Override
    protected int getItemViewLayoutId(int position, String item) {
        return R.layout.dialog_item;
    }
}
